<?php
namespace gnomephp\input;
/**
 * Secure input class.
 * @author peec
 *
 */
class Input{
	
	/**
	 * Use this when dealing with $_POST array.
	 * This is a secure filtered instance of $_POST
	 * @var gnomephp\input\Post
	 */
	public $post;
	/**
	 * Use this when dealing with $_GET array.
	 * This is a secure filtered instance of $_GET
	 * @var gnomephp\input\Get
	 */
	public $get;
	
	/**
	 * Use this when dealing with $_COOKIE array.
	 * This is a secure filtered instance of $_COOKIE.
	 * @var gnomephp\input\Cookie
	 */
	public $cookie;
	
	/**
	 * Use this when dealing with $_SERVER array.
	 * This is a secure filtered instance of $_SERVER.
	 * @var gnomephp\input\Server
	 */
	public $server;
	
	/**
	 * Use this when dealing with $_FILES array.
	 * Upload mechanisms and validation rules for $_FILES.
	 * @var gnomephp\input\Files
	 */
	public $files;
	
	public function __construct(){
		if (isset($_GET) && count($_GET) > 0)$this->get = new Get();
		if (isset($_POST) && count($_POST) > 0)$this->post = new Post();
		if (isset($_COOKIE) && count($_COOKIE) > 0)$this->cookie = new Cookie();
		if (isset($_SERVER) && count($_SERVER) > 0)$this->server = new Server();
		if (isset($_FILES) && count($_FILES) > 0)$this->files = new Files();
	}
	
}